import { singleton, container } from "src/common/services/di";
import { BehaviorSubject } from 'rxjs';

@singleton()
class LayoutControlService {
  private _showHeader$ = new BehaviorSubject(true);
  private _showFooter$ = new BehaviorSubject(true);

  public setShowHeader(b: boolean): void {
    this._showHeader$.next(b);
  };

  public setShowFooter(b: boolean): void {
    this._showFooter$.next(b);
  };

  get showHeader$() {
    return this._showHeader$.asObservable();
  };

  get showFooter$() {
    return this._showFooter$.asObservable();
  };
};

export const layoutControlServiceFactory = () => {
  return container.resolve(LayoutControlService);
};